
import React,{useEffect} from 'react'
import {useParams} from 'react-router-dom'
// import store from '../redux/store'
import { show,hide } from '../actionCreator/TabbarActionCreator'
// import store from '../redux/store'
import {connect} from 'react-redux'
 function Detail(props) {
    let params=useParams()
    let id=params.id
    useEffect(() => {
        console.log("create")
        // 发布发送数据跳转tabbar
        // store.dispatch({
        //     type:"hide-tabbar"
        // })
        props.hide()
        return()=>{
            console.log("destory")
            // store.dispatch({
            //     type:"show-tabbar"
            // })
            props.show()
        }
        
    }, [props.show,props.hide])

    return (
        <div>
            deteail--{id}
        </div>
    )
}
// connect(将来给孩子传的属性，将来给孩子回调函数)
const mapDispatchToProps={
    show,
    hide
}
export default connect(null,mapDispatchToProps)(Detail)